#include <iostream>
using std::cout;
using std::endl;

//Point二维平面上面的点
class Point{
public:
    //主动去提供一个构造函数
    //自己主动编写一个有参构造函数之后，发现下面的point
    //对象创建的代码报错
    Point(int x, int y){
        _ix = x;
        _iy = y;
    }
    Point(){
        _ix = 0;
        _iy = 0;
    }


    void print(){
        cout << "(" << _ix << "," << _iy << ")" << endl;
    }


private:
    int _ix;
    int _iy;
};


void test(){
    Point pt;//利用无参构造函数来创建一个pt对象
    pt.print();

    Point pt2(1, 2);//利用有参构造函数来创建一个pt对象
    pt2.print();
}

int main()
{
    test();
    return 0;
}

